Skip to content

Turn off SIV after the first block on process_file#54

Merged
datumbox merged 4 commits into
mainfrom
turn_off_siv
Jun 20, 2025
Merged

Turn off SIV after the first block on process_file#54
datumbox merged 4 commits into
mainfrom
turn_off_siv

Conversation

@datumbox

@datumbox datumbox commented Jun 20, 2025

Copy link
Copy Markdown
Owner

We disable the SIV initialisation after the first block is processed in process_file. The SIV mechanism is used to make the encryption more resilient to accidental seed reuse. Given the seed evolution employed by VernamVeil, it only makes sense to have this feature on for the first block and disable it for subsequent blocks.

On macOS 4-6% speed up on a 1GB file:

Before:
The 'encode' step took 1.193 seconds.
The 'decode' step took 1.377 seconds.

After:
The 'encode' step took 1.119 seconds
The 'decode' step took 1.328 seconds.

Though up to now, I report benchmarks on PRs for both mac and Linux, I'll stop reporting the main benchmarks on Linux primarily because my Linux machine is a bit dated and its hardware produces high-variance measurements. MacOS is far more consistent across benchmarks, making comparisons clearer. For PRs that affect x86 instructions, I might consider an AWS instance.

@datumbox datumbox merged commit 749eadd into main Jun 20, 2025
25 checks passed
@datumbox datumbox deleted the turn_off_siv branch June 20, 2025 23:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant